<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PID_Study: E:/STM32CubeIDEWorkspace/noRTOS/PID_Study/Drivers/BSP/Inc/keyled.h 文件参考</title>
<link rel="icon" href="Doxygen-55px.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="Doxygen-55px.png"/></td>
  <td id="projectalign">
   <div id="projectname">PID_Study<span id="projectnumber">&#160;v1.0.0</span>
   </div>
   <div id="projectbrief">doc for PID_Study</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a href="dir_0c97d201d54b8b5817233953fc3aadb6.html">STM32CubeIDEWorkspace</a></li><li class="navelem"><a href="dir_f3310f12da31771255acec658cd4246d.html">noRTOS</a></li><li class="navelem"><a href="dir_8022218a35d1971722714ae72b00e870.html">PID_Study</a></li><li class="navelem"><a href="dir_17bc370c857333bc4166d76f67bb735c.html">Drivers</a></li><li class="navelem"><a href="dir_b62ba9d628590829d5c152676ba50098.html">BSP</a></li><li class="navelem"><a href="dir_a3931c23c62a4333dd07fbd46d82639c.html">Inc</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">结构体</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle"><div class="title">keyled.h 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>按键与LED驱动接口头文件  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &quot;main.h&quot;</code><br />
</div>
<p><a href="keyled_8h_source.html">浏览该文件的源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-nested-classes" class="groupheader"><a id="nested-classes" name="nested-classes"></a>
结构体</h2></td></tr>
<tr class="memitem:KEY" id="r_KEY"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_k_e_y.html">KEY</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">按键结构体定义  <a href="struct_k_e_y.html#details">更多...</a><br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-define-members" class="groupheader"><a id="define-members" name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:ac2491095a425d82ae937bb194de40961" id="r_ac2491095a425d82ae937bb194de40961"><td class="memItemLeft" align="right" valign="top"><a id="ac2491095a425d82ae937bb194de40961" name="ac2491095a425d82ae937bb194de40961"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>KEY_ON</b>&#160;&#160;&#160;GPIO_PIN_RESET</td></tr>
<tr class="memdesc:ac2491095a425d82ae937bb194de40961"><td class="mdescLeft">&#160;</td><td class="mdescRight">按键按下状态 <br /></td></tr>
<tr class="memitem:a7064269890c7e047ff576207dcc9b178" id="r_a7064269890c7e047ff576207dcc9b178"><td class="memItemLeft" align="right" valign="top"><a id="a7064269890c7e047ff576207dcc9b178" name="a7064269890c7e047ff576207dcc9b178"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>KEY_OFF</b>&#160;&#160;&#160;GPIO_PIN_SET</td></tr>
<tr class="memdesc:a7064269890c7e047ff576207dcc9b178"><td class="mdescLeft">&#160;</td><td class="mdescRight">按键松开状态 <br /></td></tr>
<tr class="memitem:ace9ae71c88b36af9d91a3d3d6d7bd5db" id="r_ace9ae71c88b36af9d91a3d3d6d7bd5db"><td class="memItemLeft" align="right" valign="top"><a id="ace9ae71c88b36af9d91a3d3d6d7bd5db" name="ace9ae71c88b36af9d91a3d3d6d7bd5db"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>KEYNUMMER</b>&#160;&#160;&#160;8</td></tr>
<tr class="memdesc:ace9ae71c88b36af9d91a3d3d6d7bd5db"><td class="mdescLeft">&#160;</td><td class="mdescRight">支持的按键数量 <br /></td></tr>
<tr class="memitem:a9a79e08fdc349f66a351a51bb8d08e7e" id="r_a9a79e08fdc349f66a351a51bb8d08e7e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9a79e08fdc349f66a351a51bb8d08e7e">K1_MASK</a>&#160;&#160;&#160;((uint32_t)0x0001)</td></tr>
<tr class="memdesc:a9a79e08fdc349f66a351a51bb8d08e7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">KeyValue值的含义说明  <br /></td></tr>
<tr class="memitem:a4caf9c54f7fa5f48653dd433679943e6" id="r_a4caf9c54f7fa5f48653dd433679943e6"><td class="memItemLeft" align="right" valign="top"><a id="a4caf9c54f7fa5f48653dd433679943e6" name="a4caf9c54f7fa5f48653dd433679943e6"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>K2_MASK</b>&#160;&#160;&#160;((uint32_t)0x0002)</td></tr>
<tr class="memdesc:a4caf9c54f7fa5f48653dd433679943e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">key2 掩码 <br /></td></tr>
<tr class="memitem:a42e6d953a6f4c5b5ad6cbe726d927721" id="r_a42e6d953a6f4c5b5ad6cbe726d927721"><td class="memItemLeft" align="right" valign="top"><a id="a42e6d953a6f4c5b5ad6cbe726d927721" name="a42e6d953a6f4c5b5ad6cbe726d927721"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>K3_MASK</b>&#160;&#160;&#160;((uint32_t)0x0004)</td></tr>
<tr class="memdesc:a42e6d953a6f4c5b5ad6cbe726d927721"><td class="mdescLeft">&#160;</td><td class="mdescRight">key3 掩码 <br /></td></tr>
<tr class="memitem:a78397d1f0f17e4c0991215cdd97771ca" id="r_a78397d1f0f17e4c0991215cdd97771ca"><td class="memItemLeft" align="right" valign="top"><a id="a78397d1f0f17e4c0991215cdd97771ca" name="a78397d1f0f17e4c0991215cdd97771ca"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>K4_MASK</b>&#160;&#160;&#160;((uint32_t)0x0008)</td></tr>
<tr class="memdesc:a78397d1f0f17e4c0991215cdd97771ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">key4 掩码 <br /></td></tr>
<tr class="memitem:ad69ad86ce414eab64e04d450955a38c7" id="r_ad69ad86ce414eab64e04d450955a38c7"><td class="memItemLeft" align="right" valign="top"><a id="ad69ad86ce414eab64e04d450955a38c7" name="ad69ad86ce414eab64e04d450955a38c7"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>K5_MASK</b>&#160;&#160;&#160;((uint32_t)0x0010)</td></tr>
<tr class="memdesc:ad69ad86ce414eab64e04d450955a38c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">key5 掩码 <br /></td></tr>
<tr class="memitem:a121a9679e2e68670366d636254d1cd88" id="r_a121a9679e2e68670366d636254d1cd88"><td class="memItemLeft" align="right" valign="top"><a id="a121a9679e2e68670366d636254d1cd88" name="a121a9679e2e68670366d636254d1cd88"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>K6_MASK</b>&#160;&#160;&#160;((uint32_t)0x0020)</td></tr>
<tr class="memdesc:a121a9679e2e68670366d636254d1cd88"><td class="mdescLeft">&#160;</td><td class="mdescRight">key6 掩码 <br /></td></tr>
<tr class="memitem:a585a4beb84cf6cb53446d4ff12a6866d" id="r_a585a4beb84cf6cb53446d4ff12a6866d"><td class="memItemLeft" align="right" valign="top"><a id="a585a4beb84cf6cb53446d4ff12a6866d" name="a585a4beb84cf6cb53446d4ff12a6866d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>K7_MASK</b>&#160;&#160;&#160;((uint32_t)0x0040)</td></tr>
<tr class="memdesc:a585a4beb84cf6cb53446d4ff12a6866d"><td class="mdescLeft">&#160;</td><td class="mdescRight">key7 掩码 <br /></td></tr>
<tr class="memitem:a02e0b0f73b4e7b7bac92ee546460699d" id="r_a02e0b0f73b4e7b7bac92ee546460699d"><td class="memItemLeft" align="right" valign="top"><a id="a02e0b0f73b4e7b7bac92ee546460699d" name="a02e0b0f73b4e7b7bac92ee546460699d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>K8_MASK</b>&#160;&#160;&#160;((uint32_t)0x0080)</td></tr>
<tr class="memdesc:a02e0b0f73b4e7b7bac92ee546460699d"><td class="mdescLeft">&#160;</td><td class="mdescRight">key8 掩码 <br /></td></tr>
<tr class="memitem:ad0c475de6664a29bd77b0a977b7be38b" id="r_ad0c475de6664a29bd77b0a977b7be38b"><td class="memItemLeft" align="right" valign="top"><a id="ad0c475de6664a29bd77b0a977b7be38b" name="ad0c475de6664a29bd77b0a977b7be38b"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>KEY_MASK</b>&#160;&#160;&#160;((uint32_t)0x00FF)</td></tr>
<tr class="memdesc:ad0c475de6664a29bd77b0a977b7be38b"><td class="mdescLeft">&#160;</td><td class="mdescRight">所有按键掩码 <br /></td></tr>
<tr class="memitem:a91fa1110d81cc96675036a9dc895db23" id="r_a91fa1110d81cc96675036a9dc895db23"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a91fa1110d81cc96675036a9dc895db23">IS_KEYMASK</a>(mask)</td></tr>
<tr class="memdesc:a91fa1110d81cc96675036a9dc895db23"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断按键掩码是否合法  <br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a163c33d782903dc5b144a6ece1765bf8" id="r_a163c33d782903dc5b144a6ece1765bf8"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a163c33d782903dc5b144a6ece1765bf8">Key_Register</a> (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t KeyMask, void(*KeyAction)(void))</td></tr>
<tr class="memdesc:a163c33d782903dc5b144a6ece1765bf8"><td class="mdescLeft">&#160;</td><td class="mdescRight">注册按键  <br /></td></tr>
<tr class="memitem:a726ac7d6b0f3fe5a3754e954a17a2e61" id="r_a726ac7d6b0f3fe5a3754e954a17a2e61"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a726ac7d6b0f3fe5a3754e954a17a2e61">Key_Read_block</a> (void)</td></tr>
<tr class="memdesc:a726ac7d6b0f3fe5a3754e954a17a2e61"><td class="mdescLeft">&#160;</td><td class="mdescRight">阻塞方式读取按键  <br /></td></tr>
<tr class="memitem:ad42fb9ae531cdf757d1e6b7138611068" id="r_ad42fb9ae531cdf757d1e6b7138611068"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad42fb9ae531cdf757d1e6b7138611068">Key_Read_unblock</a> (uint32_t division)</td></tr>
<tr class="memdesc:ad42fb9ae531cdf757d1e6b7138611068"><td class="mdescLeft">&#160;</td><td class="mdescRight">非阻塞方式读取按键  <br /></td></tr>
<tr class="memitem:a932200eb589077d9d88b9b8bcff5fac8" id="r_a932200eb589077d9d88b9b8bcff5fac8"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a932200eb589077d9d88b9b8bcff5fac8">Key_Flag_Receive</a> (void)</td></tr>
<tr class="memdesc:a932200eb589077d9d88b9b8bcff5fac8"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取按键标志位  <br /></td></tr>
<tr class="memitem:afa4846032f413dbd897fb0a2317df759" id="r_afa4846032f413dbd897fb0a2317df759"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afa4846032f413dbd897fb0a2317df759">Key_Flag_Action</a> (uint32_t KeyFlag)</td></tr>
<tr class="memdesc:afa4846032f413dbd897fb0a2317df759"><td class="mdescLeft">&#160;</td><td class="mdescRight">按键标志位动作处理  <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">详细描述</h2>
<div class="textblock"><p>按键与LED驱动接口头文件 </p>
<dl class="section author"><dt>作者</dt><dd>废话文学创始人 </dd></dl>
<dl class="section version"><dt>版本</dt><dd>1.0 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2024-02-25 </dd></dl>
</div><a name="doc-define-members" id="doc-define-members"></a><h2 id="header-doc-define-members" class="groupheader">宏定义说明</h2>
<a id="a91fa1110d81cc96675036a9dc895db23" name="a91fa1110d81cc96675036a9dc895db23"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a91fa1110d81cc96675036a9dc895db23">&#9670;&#160;</a></span>IS_KEYMASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define IS_KEYMASK</td>
          <td>(</td>
          <td class="paramtype"></td>          <td class="paramname"><span class="paramname"><em>mask</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>值:</b><div class="fragment"><div class="line">(((((uint32_t)mask) &amp; GPIO_PIN_MASK) != 0x00u) &amp;&amp; ((((uint32_t)mask) &amp; ~GPIO_PIN_MASK) == 0x00u))</div>
</div><!-- fragment -->
<p>判断按键掩码是否合法 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">mask</td><td>按键掩码 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9a79e08fdc349f66a351a51bb8d08e7e" name="a9a79e08fdc349f66a351a51bb8d08e7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a79e08fdc349f66a351a51bb8d08e7e">&#9670;&#160;</a></span>K1_MASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define K1_MASK&#160;&#160;&#160;((uint32_t)0x0001)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>KeyValue值的含义说明 </p>
<dl class="section note"><dt>注解</dt><dd>初始状态 0000 0000 0000 0000 0000 0000 0000 0000&mdash;32bit </dd>
<dd>
K1按下 0000 0000 0000 0000 0000 0000 0000 0001 </dd>
<dd>
K3按下 0000 0000 0000 0000 0000 0000 0000 0100 </dd>
<dd>
K1K3都按下 0000 0000 0000 0000 0000 0000 0000 0101 </dd>
<dd>
只定义了8个按键，按需添加</dd></dl>
<p>key1 掩码 </p>

</div>
</div>
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">函数说明</h2>
<a id="afa4846032f413dbd897fb0a2317df759" name="afa4846032f413dbd897fb0a2317df759"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa4846032f413dbd897fb0a2317df759">&#9670;&#160;</a></span>Key_Flag_Action()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Key_Flag_Action </td>
          <td>(</td>
          <td class="paramtype">uint32_t</td>          <td class="paramname"><span class="paramname"><em>KeyFlag</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>按键标志位动作处理 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">KeyFlag</td><td>按键标志位</td></tr>
  </table>
  </dd>
</dl>
<p>按键标志位动作处理</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">KeyFlag</td><td>按键标志位 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a932200eb589077d9d88b9b8bcff5fac8" name="a932200eb589077d9d88b9b8bcff5fac8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a932200eb589077d9d88b9b8bcff5fac8">&#9670;&#160;</a></span>Key_Flag_Receive()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Key_Flag_Receive </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取按键标志位 </p>
<dl class="section return"><dt>返回</dt><dd>当前按键标志位</dd></dl>
<p>获取按键标志位</p>
<dl class="section return"><dt>返回</dt><dd>当前按键标志位 </dd></dl>

</div>
</div>
<a id="a726ac7d6b0f3fe5a3754e954a17a2e61" name="a726ac7d6b0f3fe5a3754e954a17a2e61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a726ac7d6b0f3fe5a3754e954a17a2e61">&#9670;&#160;</a></span>Key_Read_block()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Key_Read_block </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>阻塞方式读取按键 </p>
<p>阻塞方式读取按键</p>
<dl class="section note"><dt>注解</dt><dd>标志存入KeyFlag </dd></dl>

</div>
</div>
<a id="ad42fb9ae531cdf757d1e6b7138611068" name="ad42fb9ae531cdf757d1e6b7138611068"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad42fb9ae531cdf757d1e6b7138611068">&#9670;&#160;</a></span>Key_Read_unblock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Key_Read_unblock </td>
          <td>(</td>
          <td class="paramtype">uint32_t</td>          <td class="paramname"><span class="paramname"><em>division</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>非阻塞方式读取按键 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">division</td><td>分频参数</td></tr>
  </table>
  </dd>
</dl>
<p>非阻塞方式读取按键</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">division</td><td>控制函数的实际执行次数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>标志存入KeyFlag </dd>
<dd>
无滤波算法，当实际扫描间隔大于20ms即可去抖 </dd>
<dd>
建议扫描时间在20ms~100ms内 </dd></dl>

</div>
</div>
<a id="a163c33d782903dc5b144a6ece1765bf8" name="a163c33d782903dc5b144a6ece1765bf8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a163c33d782903dc5b144a6ece1765bf8">&#9670;&#160;</a></span>Key_Register()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t Key_Register </td>
          <td>(</td>
          <td class="paramtype">GPIO_TypeDef *</td>          <td class="paramname"><span class="paramname"><em>GPIOx</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t</td>          <td class="paramname"><span class="paramname"><em>GPIO_Pin</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t</td>          <td class="paramname"><span class="paramname"><em>KeyMask</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*</td>          <td class="paramname"><span class="paramname"><em>KeyAction&#160;</em></span>)(void)&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>注册按键 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">GPIOx</td><td>按键GPIO端口 </td></tr>
    <tr><td class="paramname">GPIO_Pin</td><td>按键GPIO引脚 </td></tr>
    <tr><td class="paramname">KeyMask</td><td>按键掩码 </td></tr>
    <tr><td class="paramname">KeyAction</td><td>按键动作回调函数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>注册结果，0为失败，1为成功 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>使用前需要对按键进行注册</dd></dl>
<p>注册按键</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">GPIOx</td><td>按键对应端口 </td></tr>
    <tr><td class="paramname">GPIO_Pin</td><td>按键对应管脚 </td></tr>
    <tr><td class="paramname">KeyMask</td><td>按键掩码，详见keyled.h </td></tr>
    <tr><td class="paramname">KeyAction</td><td>按键单击的回调函数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>注册结果，0为失败，1为成功 </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
